 <#include "admin/template/page/head_lib.html">
<body>
	<div class="layui-fluid">
		<form class="layui-form" id="edit_form" isLoad="1"
			loadUrl="comn/service/detail.json?sqlid=system.menu.detail">
			<input type="hidden" name="menu_id" />
			<div class="layui-form-item">
				<label class="layui-form-label">菜单类型</label>
				<div class="layui-input-block">
					<input type="radio" name="type" value="1" title="菜单"
						checked="checked">
					<input type="radio" name="type" value="2" title="按钮">
					<input type="radio" name="type" value="3" title="其它">
				</div>
			</div>
	 	   <div class="layui-form-item">
				<label class="layui-form-label">菜单名称</label>
				<div class="layui-input-inline" >
					<input type="text" name="name" required="" lay-verType="tips"
						lay-verify="required" placeholder="请输入菜单名称" autocomplete="off"
						class="layui-input" />
				</div>
				<label class="layui-form-label">上级菜单</label>
				<div class="layui-input-inline">
					<input type="hidden" name="parent_id" id="penter_menu"  value="0"/>
					<input type="text" name="parent_name" required="" id="menu" lay-verType="tips"
						lay-verify="required" placeholder="请选择上级菜单" autocomplete="off"
						class="layui-input" />
				</div>
			</div>
	 	   <div class="layui-form-item">
				<label class="layui-form-label">跳转地址</label>
				<div class="layui-input-inline"  >
					<input type="text" name="url" placeholder="请输入跳转地址" autocomplete="off"
						class="layui-input" />
				</div>
				<label class="layui-form-label">排序</label>
				<div class="layui-input-inline"  >
					<input type="text" name="order_num" required=""  lay-verType="tips"
						lay-verify="number"   placeholder="请输入排序" autocomplete="off"
						class="layui-input" />
				</div>
			</div>
	 	   <div class="layui-form-item">
				<label class="layui-form-label">权限标识</label>
				<div class="layui-input-inline"  >
					<input type="text" name="perms" required="" lay-verType="tips"
						lay-verify="required" placeholder="请输入权限标识" autocomplete="off"
						class="layui-input" />
				</div>
				<label class="layui-form-label">图标</label>
				<div class="layui-input-inline"  >
					<input type="text" name="icon"  placeholder="请输入图标" autocomplete="off"
						class="layui-input" />
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">状态</label>
				<div class="layui-input-block">
					<input type="checkbox" name="status" lay-skin="switch"
						lay-text="显示|不显" value="1" checked>
				</div>
			</div>	
			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label">备注</label>
				<div class="layui-input-block" style="width: 500px;">
					<textarea name="remark" placeholder="请输入描述" class="layui-textarea"
						height="80" width="400"></textarea>
				</div>
			</div>
			<hr />
			<div class="layui-form-item" style="text-align: center;">
				<button class="layui-btn" lay-submit="" lay-filter="edit"
					url="comn/service/update.json?sqlid=system.menu.update">
					<i class="layui-icon">&#xe642;</i>编辑
				</button>
				<button type="button" class="layui-btn layui-btn-primary"
					function="close">关闭</button>
			</div>
	</div>
	</form>
	</div>
	<script type="text/javascript">
	var ztree={};
	$("#menu").click(function(){
	var  that = this;
		 top.layer.open({
			type: 2,
			offset: 'auto',
			skin: 'layui-layer-molv',
			title: "选择菜单",
			area: ['300px', '450px'],
			shade: 0,
			shadeClose: false,
			content: "f.html?p=system/menu/tree.html",
			btn: ['确定', '取消'],
			btn1: function (index,layero) {
                var iframeWin = layero.find('iframe')[0]; 
				var node = iframeWin.contentWindow.ztree.getSelectedNodes();
				var parentId = node[0].menu_id;
				var parentName = node[0].name;
				that.value=parentName;
				$("#penter_menu").val(parentId);
			    top.layer.close(index); 
            }
		});
	})
	</script>
</body>
</html>
